import { useRoutes } from 'react-router-dom'
import Home from '@/views/home'
import TestFlux from '@/views/testFlux'
import TestMoment from '@/views/testMoment'
import TestHooks from '@/views/testHooks'

const routes = [
	{
		path: '/home',
		name: '首页',
		element: <Home />,
		exact: true,
	},
	{
		path: '/testFlux',
		name: 'testFlux',
		element: <TestFlux />,
	},
	{
		path: '/testMoment',
		name: 'testMoment',
		element: <TestMoment />,
	},
  {
		path: '/testHooks',
		name: 'testHooks',
		element: <TestHooks />,
	},
	{
		path: '*',
		element: <Home />,
	},
]

const ConfigRoutes = () => {
	return useRoutes(routes)
}

export default ConfigRoutes
